# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
	include ShowAndHideHelper
	include SortArrowsHelper
	
	
	def page_title(controller)
		controller.controller_name.titleize
	end
	
	def hash_to_html(hash)
		ones = []
		hashes = []
		hash.each do |k,v| 
			if hash[k].is_a?(Hash)
				hashes << "#{k} => [" + hash[k].map {|k,v| "#{k}: <em>#{v}</em>" }.join(" | ") + "] "
			else
				ones << "#{k}: <em>#{v}</em>"
			end
		end
		(ones + hashes).join(" || ")
	end
end
